package filelog

// Change the sizeSplit fileLogger's bak file count
func (f *FileLogger) SetMaxFileCount(count int) int {
	f.fileCount = count
	return f.fileCount
}

// Change the sizeSplit fileLogger's single file size
func (f *FileLogger) SetMaxFileSize(size int64, unit UNIT) int64 {
	f.fileSize = size * int64(unit)
	return f.fileSize
}

// SetPrefix sets the output prefix for the logger.
func (f *FileLogger) SetPrefix(prefix string) {
	f.lg.SetPrefix(prefix)
}

// SetFlags sets the output flags for the logger.
func (f *FileLogger) SetFlags(flag int) {
	f.lg.SetFlags(flag)
}

// SetLogSeq sets the logChan's buffer size
func (f *FileLogger) SetLogSeq(logSeq int) {
	//TODO How to change channel buffer size when channel has data
}

// SetLogScanInterval sets the ticker's interval
func (f *FileLogger) SetLogScanInterval(interval int64) {
	//TODO How to change logScan Interval when ticker is running
}

// SetLogLevel sets the output log's Level: TRACE<INFO<WARN<ERROR<OFF
func (f *FileLogger) SetLogLevel(level LEVEL) {
	if f.logLevel == OFF && level != OFF {
		f.fileCheck()
	}
	f.logLevel = level
}

// SetLogConsole sets whether the log string will print in console, default is false
func (f *FileLogger) SetLogConsole(console bool) {
	f.logConsole = console
}

// AddCallerSkip
func (f *FileLogger) SetAddSkipCaller(skip int) {
	f.skipCaller = skip
}

func (f *FileLogger) SetLogCaller(logCall bool) {
	f.logCaller = logCall
}

// Copy from go sdk
// These flags define which text to prefix to each log entry generated by the Logger.
const (
	// Bits or'ed together to control what's printed. There is no control over the
	// order they appear (the order listed here) or the format they present (as
	// described in the comments).  A colon appears after these items:
	//	2009/01/23 01:23:23.123123 /a/b/c/d.go:23: message
	Ldate         = 1 << iota     // the date: 2009/01/23
	Ltime                         // the time: 01:23:23
	Lmicroseconds                 // microsecond resolution: 01:23:23.123123.  assumes Ltime.
	Llongfile                     // full file name and line number: /a/b/c/d.go:23
	Lshortfile                    // final file name element and line number: d.go:23. overrides Llongfile
	LstdFlags     = Ldate | Ltime // initial values for the standard logger
)
